package com.liyujie.splitscreen.ui.home;

import android.app.Presentation;
import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.WindowManager;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.liyujie.splitscreen.R;
import com.liyujie.splitscreen.ui.home.adapter.DifferentDisplayAdapter;

import java.util.List;

public class DifferentDisplay extends Presentation {

    private DifferentDisplayAdapter differentDisplayAdapter;

    private RecyclerView mRecyclerView;

    public DifferentDisplay(Context outerContext, Display display) {
        super(outerContext, display);
        getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
    }

    public DifferentDisplay(Context outerContext, Display display, int theme) {
        super(outerContext, display, theme);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_display_manager);

        mRecyclerView = findViewById(R.id.RecyclerView);
        differentDisplayAdapter = new DifferentDisplayAdapter();
        mRecyclerView.setLayoutManager(new GridLayoutManager(getContext(),10));
        mRecyclerView.setAdapter(differentDisplayAdapter);
    }

    /**
     *
     * @param stringList
     */
    public void setStringList(List<String> stringList){
        if(null != differentDisplayAdapter){
            differentDisplayAdapter.setStringList(stringList);
        }
    }


}
